package com.gxa.controller.dmt.attendance;

import com.gxa.common.R;
import com.gxa.common.vo.AttendancePageRequest;
import com.gxa.service.AttendanceMonthService;
import com.gxa.service.AttendanceService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/attendance/attendMonth")
@Api(value = "考勤月报表管理",tags = "考勤月报表管理接口API")
@RequiresRoles(value = {"超级管理员","院长","主任","秘书"},logical = Logical.OR)
public class AttendanceMonthController {

    @Autowired
    AttendanceMonthService service;
    @ApiOperation(value = "显示所有考勤列表信息",notes = "显示所有考勤列表信息",
            httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @RequestMapping(value = "/showMonthList",method = RequestMethod.POST)
    @ResponseBody
    public R showMonthList(@RequestBody @ApiParam(name = "attendancePageRequest",value = "请求过来的Page信息",required = true) AttendancePageRequest attendancePageRequest){

        System.out.println(attendancePageRequest);
        R r = service.showMonthList(attendancePageRequest);
        return r;
    }




}
